<template>
  <div class="div1">
    <echart :options="option1" class="echarts1"></echart>
      <div class="div2">
        <table class="tablesss">
            <tbody>
                <tr v-for="(item,index) in sysFaultData">
                  <td>{{item.name}}</td>
                  <td>{{item.value}}</td>
                </tr>
            </tbody>
        </table>
      </div>
    <echart :options="option2" class="echarts2"></echart>
  </div>
</template>

<style scoped>
.div2 {
  float: right;
  height:60%;
  width: 45%;
}
.div1 {
  height: 100%;
  width: 100%;
  border-radius: 0px;
  background-color: #0d2a42;
}
table td {
  width: 50%;
  color: #4ab8bf;
  background-color: #0a2732;
  border-top: 0;
  border-left: 0;
  border-right: 1px solid #4ab8bf;
  border-bottom: 1px solid #4ab8bf;
}
table tr:last-child td {
  border-bottom: 0;
}
table tr th:last-child{
    border-right: 0;
}
table tr td:last-child {
  text-align: center;
  border-right: 0;
}

table {
  position:relative;
  top:12%;
  border: 0px;
  width: 100%;
  min-height: 25px;
  line-height: 25px;
  border-collapse: collapse;
  padding: 2px;

}
.echarts1 {
  float: left;
  height: 60%;
  width: 55%;
}
.echarts2 {
  float: left;
  height: 40%;
  width: 100%;
}
</style>
<script>
var data = [
  {
    value: 100,
    name: "已处理"
  },
  {
    value: 200,
    name: "未处理"
  }
];
var date = [[0.81], [0.9], [0.2], [0.1]];
export default {
  methods: {
  },
  data: function() {
    return {
      sysFaultData: [
        { name: "今日更新数", value: "2" },
        { name: "新增设备数", value: "11" },
        { name: "过保设备数", value: "5" },
        { name: "设备宕机数", value: "0" },
        { name: "工单平均响应时间", value: "15min" },
        { name: "工单平均解决时间", value: "220min" }
      ],
      option1: {
        backgroundColor: "#0D2A42",
        title: [
          {
            text: "今日服务运维统计                           ",
            left: "8%",
            top: "1%",
            textStyle: {
              color: "#eedfbe",
            },
            backgroundColor: "#0a3c60"
          }
        ],
        series: [
          {
            type: "pie",
            selectedMode: "single",
            radius: [0, "50%"],
            center: ["50%", "50%"],
            color: ["#4cd3e3", "#146acf"],
            label: {
              normal: {
                formatter: "{b}\n  {c} ({d}%)",
                textStyle: {
                  color: "#fff"
                }
              }
            },
            labelLine: {
              normal: {
                show: true,
                lineStyle: {
                  color: "#fff"
                },
                smooth: 0.2,
                length: 5,
                length2: 5
              }
            },
            data: data
          }
        ]
      },
      option2: {
        backgroundColor: "#0D2A42",
        title: [
          {
            text: "工单完成率",
            textStyle: {
              fontSize: 15,
              color: "#fff"
            },
            left: "11%",
            top: "80%",
            textAlign: "center",
            textBaseAlign: "middle"
          },
          {
            text: "工单响应率",
            textStyle: {
              fontSize: 15,
              color: "#fff"
            },
            left: "36%",
            top: "80%",
            textAlign: "center",
            textBaseAlign: "middle"
          },
          {
            text: "紧急工单率",
            textStyle: {
              fontSize: 15,
              color: "#fff"
            },
            left: "61%",
            top: "80%",
            textAlign: "center",
            textBaseAlign: "middle"
          },
          {
            text: "严重工单率",
            textStyle: {
              fontSize: 15,
              color: "#fff"
            },
            left: "86%",
            top: "80%",
            textAlign: "center",
            textBaseAlign: "middle"
          }
        ],
        series: [
          {
            type: "liquidFill",
            data: date[0],
            radius: "70%",
            // 水球颜色
            color: ["#436EEE"],
            center: ["12%", "38%"],
            // 内图 背景色 边
            backgroundStyle: {
              color: "#0D2A42"
            },
            label: {
              normal: {
                color: "white",
                insideColor: "white",
                fontSize: 20
              }
            }
          },
          {
            type: "liquidFill",
            data: date[1],
            radius: "70%",
            // 水球颜色
            color: ["#436EEE"],
            center: ["37%", "38%"],
            // 内图 背景色 边
            backgroundStyle: {
              color: "#0D2A42"
            },
            label: {
              normal: {
                color: "white",
                insideColor: "white",
                fontSize: 20
              }
            }
          },
          {
            type: "liquidFill",
            data: date[2],
            radius: "70%",
            // 水球颜色
            color: ["#436EEE"],
            center: ["62%", "38%"],
            // 内图 背景色 边
            backgroundStyle: {
              color: "#0D2A42"
            },
            label: {
              normal: {
                color: "white",
                insideColor: "white",
                fontSize: 20
              }
            }
          },
          {
            type: "liquidFill",
            data: date[3],
            radius: "70%",
            // 水球颜色
            color: ["#436EEE"],
            center: ["87%", "38%"],
            // 内图 背景色 边
            backgroundStyle: {
              color: "#0D2A42"
            },
            label: {
              normal: {
                color: "white",
                insideColor: "white",
                fontSize: 20
              }
            }
          }
        ]
      }
    };
  }
};
</script>
